package com.superteam.mac.web.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.superteam.mac.base.data.DataBean;
import com.superteam.mac.base.web.action.BaseAction;
import com.superteam.mac.mode.IndexRec;

public class IndexRecAction extends BaseAction {

	
	public ActionForward findAllIndexRec(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String workshop = (String)request.getSession().getAttribute("real_line_cur_workshop");
		
		String machine = (String)request.getSession().getAttribute("real_line_cur_machine");
		List<IndexRec> list = this.getIndexRecDAO().findByConnection(workshop, machine, null, null);
		for(IndexRec index:list)
		{
			String machineName = DataBean.getMachineName(index.getMachineCode());
			index.setMachineName(machineName);
		}
		
		request.setAttribute("recs", list);
		return mapping.findForward("infor_right");
	}

}
